<?php
session_start();
require "lib/db.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Report</title>
<link rel="stylesheet" type="text/css" href="css/home.css">
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>

<script>
	$(document).ready(function() {
		$("#cartanalysis").css({"background-color":"#FFF",	
	"color":"#000"});
	
	$.get("associationrulecontroller.php",{minSup:$("#cbMinSup").val(),minConf:$("#cbMinConf").val()},function(data){
				$("#association-rules").html(data);
			});
			
	$("#cbMinSup").change(function(){
			$.get("associationrulecontroller.php",{minSup:$("#cbMinSup").val(),minConf:$("#cbMinConf").val()},function(data){
				$("#association-rules").html(data);
			});
		});
	$("#cbMinConf").change(function(){
		$.get("associationrulecontroller.php",{minSup:$("#cbMinSup").val(),minConf:$("#cbMinConf").val()},function(data){
			$("#association-rules").html(data);
		});
	});
    });
</script>
<style>
	#content{
		overflow:scroll;
		height:510px;
		margin:2px 3px;
		opacity:0.8;
		text-align:center;
	}
	
	.supcon{
		width:15%;
	}
	
	input{
		width:100px;	
	}

</style>

</head>

<body>

<!--menu-->
<?php
require "menu.php";
?>

<!--content-->
<div id="content">
	<table style="margin:2px auto;" width="30%" border="0" cellspacing="0">
      <tr>
        <td>Min Support</td>
        <td>
            <select name="cbMinSup" id="cbMinSup">
                <?php
                for($i=1;$i<=100;$i++){
                ?>
                    <option <?php if($i==5){echo 'selected="selected"';} ?>  value="<?php echo $i; ?>"><?php echo $i; ?></option>
                <?php
                }
                ?>
            </select>
        </td>
        <td>Min Confidence</td>
        <td>
            <select name="cbMinConf"  id="cbMinConf">
                <?php
                for($i=1;$i<=100;$i++){
                ?>
                    <option <?php if($i==35){echo 'selected="selected"';} ?> value="<?php echo $i; ?>"><?php echo $i; ?></option>
                <?php
                }
                ?>
            </select>
        </td>
      </tr>
    </table>
    <div id="association-rules">
    	<table width="100%" border="1" cellspacing="0">
          <tr>
            <th>Rules</th>
            <th>Support(%)</th>
            <th>Confindence(%)</th>
          </tr>
          <tr>
            <td></td>
            <td></td>
            <td></td>
          </tr>
        </table>
    </div>
    
</div>

<!--footer-->
<?php
require "footer.php";
?>



</body>
</html>